const Exception = require('../lib/exception.js')

exports.NotFound = class NotFound extends Exception {
	constructor({ message = '资源不存在', data = null, code = 10404 } = {}) {
		super({ data, message, code })
	}
}

exports.Forbbiden = class Forbbiden extends Exception {
	constructor({ message = '无访问权限', data = null, code = 10403 } = {}) {
		super({ data, message, code })
	}
}

exports.ParamsError = class ParamsError extends Exception {
	constructor({ message = '参数错误', data = null, code = 10400 } = {}) {
		super({ data, message, code })
	}
}

exports.TokenExpires = class TokenExpires extends Exception {
	constructor({ message = '登录已失效', data = null, code = 10701, token } = {}) {
		super({ data, message, code, token })
	}
}

exports.TokenIllegal = class TokenIllegal extends Exception {
	constructor({ message = 'token不合法', data = null, code = 10702, token } = {}) {
		super({ data, message, code, token })
	}
}
